/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx.oop;

/**
 * <p>Project: javaseapp - Student
 * <p>Powered by webrx On 2021-08-05 08:54:06
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Student extends User {
    static {
        System.out.println("Student static1");
    }

    public Student() {
        System.out.println("Student()");
    }

    public Student(String name) {
        super(name);
        this.name = name;
    }

    static {
        System.out.println("Student static2");
    }

    /**
     * 覆盖
     *
     * @param i int
     * @return int
     */
    public int pf(int i) {
        System.out.println("student");
        return i * i;
    }

    public void exec(int i) {
        //super() 在构造方法中，用来调用你类的构造方法; 也可以super("jack")
        //this super
        //pf(i);
        //this.pf(i);

        //调用父类的 pf
        super.pf(i);
    }

    public int pf(String i) {
        int n = Integer.parseInt(i);
        return n * n;
    }
}
